package com.iworkh.spring.data.jdbc.tx.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * biz Service
 *
 * @author: iworkh-沐雨云楼
 * @date: 2019-12-24
 */
@Service
public class BizService {

    @Autowired
    private OrderService orderService;

    @Transactional
    public void  doShopping(){
        // 买了两本，第二本半价
        // 调用两次接口,只是为了测试才这样做，跟业务无关
        orderService.makeAnOrder("1","1",60);

        orderService.makeAnOrder("1","1",30);
    }
}
